{% if form and form.errors %}
    {% for key, error in form.errors.items() %}
        <div class="alert alert-warning" role="alert">{{ error }}</div>
    {% endfor %}
{% endif %}